attach(all3)
plot1<- ggplot(all3, aes(t_state)) +
geom_density(alpha = 0.5, fill = "blue", colour = "blue") +
theme_bw() + theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(), axis.line = element_line(colour = "black")) +
labs(x="T-Statistics", y="Density", title="") +
theme(text = element_text(size=32)) +
scale_x_continuous(limits=c(-3.6, 3.6)) + theme(legend.position="none") +
geom_vline(aes(xintercept=1.96), colour="#990000", linetype="dashed", size=2) +
geom_vline(aes(xintercept=-1.96), colour="#990000", linetype="dashed", size=2) +
geom_vline(aes(xintercept=0), colour="grey", linetype="dashed", size=2) +
labs(caption = "Lower = Elected Officials Discriminate More \n Higher = Public Discriminate More")
plot1
ggsave(plot1, file="interaction_pval_dist.pdf", width=8, height=6, scale=2)
View(all3)
all3<-read.dta("interaction discrimination by state.dta")
attach(all3)
plot1<- ggplot(all3, aes(t_stat)) +
geom_density(alpha = 0.5, fill = "blue", colour = "blue") +
theme_bw() + theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(), axis.line = element_line(colour = "black")) +
labs(x="T-Statistics", y="Density", title="") +
theme(text = element_text(size=32)) +
scale_x_continuous(limits=c(-3.6, 3.6)) + theme(legend.position="none") +
geom_vline(aes(xintercept=1.96), colour="#990000", linetype="dashed", size=2) +
geom_vline(aes(xintercept=-1.96), colour="#990000", linetype="dashed", size=2) +
geom_vline(aes(xintercept=0), colour="grey", linetype="dashed", size=2) +
labs(caption = "Lower = Elected Officials Discriminate More \n Higher = Public Discriminate More")
plot1
ggsave(plot1, file="interaction_pval_dist.pdf", width=8, height=6, scale=2)
rules<-read.csv("emailcoverageclean.csv")
plot2<-ggplot(rules, aes(state, Email.Coverage))  +
geom_point(size=12) +  theme_bw() +
geom_segment(aes(x = state, y = 0, xend = state , yend = Email.Coverage), color = "black", size=3) +
labs(x="", y="Email Coverage in Acxiom Files", title="") +
theme(text = element_text(size=24)) +
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),
panel.background = element_blank(), axis.line = element_line(colour = "black"))+
scale_y_continuous(limits=c(0, 50)) +
geom_hline(aes(yintercept=39.948494), colour="blue", linetype="dashed", size=2, alpha=0.5)
plot2
ggsave(plot2, file="email_coverage.pdf", width=17, height=3, scale=2)
rules<-read.csv("correlations public.csv")
plot2<-ggplot(rules, aes(y=variable, x=corr)) +
geom_vline(aes(xintercept=0), colour="#990000", linetype="dashed", size=1)  +
geom_point(size=12) +  theme_bw() +
geom_segment(aes(x = 0, y = variable, xend = corr , yend = variable), color = "black", size=3) +
labs(x="Correlation Coefficient (Pearson R); Discrimination Against Blacks=Negative", y="Variables", title="") +
theme(text = element_text(size=22)) +
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),
panel.background = element_blank(), axis.line = element_line(colour = "black")) +
scale_x_continuous(limits=c(-1, 1))
plot2
ggsave(plot2, file="correlations_public.pdf", width=8, height=15, scale=2)
##### FIGURE S15: Predictors of Elected Discrimination
rules<-read.csv("correlations elected.csv")
plot2<-ggplot(rules, aes(y=variable, x=corr)) +
geom_vline(aes(xintercept=0), colour="#990000", linetype="dashed", size=1)  +
geom_point(size=12) +  theme_bw() +
geom_segment(aes(x = 0, y = variable, xend = corr , yend = variable), color = "black", size=3) +
labs(x="Correlation Coefficient (Pearson R); Discrimination Against Blacks=Negative", y="Variables", title="") +
theme(text = element_text(size=22)) +
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),
panel.background = element_blank(), axis.line = element_line(colour = "black")) +
scale_x_continuous(limits=c(-1, 1))
plot2
ggsave(plot2, file="correlations_elected.pdf", width=8, height=15, scale=2)
rules<-read.csv("correlations.csv")
plot2<-ggplot(rules, aes(y=variable, x=corr)) +
geom_vline(aes(xintercept=0), colour="#990000", linetype="dashed", size=1)  +
geom_point(size=12) +  theme_bw() +
geom_segment(aes(x = 0, y = variable, xend = corr , yend = variable), color = "black", size=3) +
labs(x="Correlation Coefficient (Pearson R); Discrimination Against Blacks=Negative", y="Variables", title="") +
theme(text = element_text(size=22)) +
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),
panel.background = element_blank(), axis.line = element_line(colour = "black")) +
scale_x_continuous(limits=c(-1, 1))
plot2
ggsave(plot2, file="correlations_difference_public_elected.pdf", width=8, height=15, scale=2)
diffdiffall<-read.dta("overall_effects_concordance_block_vars_south.dta")
attach(diffdiffall)
color.names <- c("#1b7837", "#762a83")
plot1<-ggplot(diffdiffall, aes(y=coef_base,  x=reorder(group, model_num)))+
geom_hline(aes(yintercept=0), colour="black", linetype="dashed", size=2, alpha=0.2) +
geom_point(data=diffdiffall, aes(colour=group), size=12) +
geom_errorbar(aes(ymin=coef_base-1.96*stderr_base, ymax=coef_base+1.96*stderr_base, colour=group), width=0, size=2) +
geom_errorbar(aes(ymin=coef_base-1.64*stderr_base, ymax=coef_base+1.64*stderr_base, colour=group), width=0, size=4) +
theme_bw() + theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(), axis.line = element_line(colour = "black")) +
labs(x="", y="Effect of a Black Request on Response Rate", title="") +
theme(plot.title = element_text(hjust = 0.5)) +
scale_y_continuous(limits=c(-.25, .25)) +
theme(text = element_text(size=22)) +
coord_flip() + theme(legend.position="none") +
scale_colour_manual(values=color.names) +
annotate("text", x = 2.4 , y = -0.13, label="Discrimination Against Blacks", colour = "grey60", size=6, fontface="bold") +
annotate("text", x = 2.4 , y = 0.13, label="Discrimination Against Whites", colour = "grey60", size=6, fontface="bold")
plot1
ggsave(plot1, file="main_effect_block_fe_south.png", width=5, height=3, scale=2)
View(diffdiffall)
diffdiffall<-read.dta("overall_effects_concordance_block_vars_south.dta")
diffdiffall<-read.dta("overall_effects_concordance_block_vars_south.dta")
attach(diffdiffall)
color.names <- c("#1b7837", "#762a83")
plot1<-ggplot(diffdiffall, aes(y=coef_base,  x=reorder(group, model_num)))+
geom_hline(aes(yintercept=0), colour="black", linetype="dashed", size=2, alpha=0.2) +
geom_point(data=diffdiffall, aes(colour=group), size=12) +
geom_errorbar(aes(ymin=coef_base-1.96*stderr_base, ymax=coef_base+1.96*stderr_base, colour=group), width=0, size=2) +
geom_errorbar(aes(ymin=coef_base-1.64*stderr_base, ymax=coef_base+1.64*stderr_base, colour=group), width=0, size=4) +
theme_bw() + theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(), axis.line = element_line(colour = "black")) +
labs(x="", y="Effect of a Black Request on Response Rate", title="") +
theme(plot.title = element_text(hjust = 0.5)) +
scale_y_continuous(limits=c(-.25, .25)) +
theme(text = element_text(size=22)) +
coord_flip() + theme(legend.position="none") +
scale_colour_manual(values=color.names) +
annotate("text", x = 2.4 , y = -0.13, label="Discrimination Against Blacks", colour = "grey60", size=6, fontface="bold") +
annotate("text", x = 2.4 , y = 0.13, label="Discrimination Against Whites", colour = "grey60", size=6, fontface="bold")
plot1
ggsave(plot1, file="main_effect_block_fe_south.png", width=5, height=3, scale=2)
diffdiffall<-read.dta("overall_effects_concordance_block_vars.dta")
attach(diffdiffall)
color.names <- c("#1b7837", "#762a83")
plot1<-ggplot(diffdiffall, aes(y=coef_base,  x=reorder(group, model_num)))+
geom_hline(aes(yintercept=0), colour="black", linetype="dashed", size=2, alpha=0.2) +
geom_point(data=diffdiffall, aes(colour=group), size=12) +
geom_errorbar(aes(ymin=coef_base-1.96*stderr_base, ymax=coef_base+1.96*stderr_base, colour=group), width=0, size=2) +
geom_errorbar(aes(ymin=coef_base-1.64*stderr_base, ymax=coef_base+1.64*stderr_base, colour=group), width=0, size=4) +
theme_bw() + theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(), axis.line = element_line(colour = "black")) +
labs(x="", y="Effect of a Black Request on Response Rate", title="") +
theme(plot.title = element_text(hjust = 0.5)) +
scale_y_continuous(limits=c(-.25, .25)) +
theme(text = element_text(size=22)) +
coord_flip() + theme(legend.position="none") +
scale_colour_manual(values=color.names) +
annotate("text", x = 2.4 , y = -0.13, label="Discrimination Against Blacks", colour = "grey60", size=6, fontface="bold") +
annotate("text", x = 2.4 , y = 0.13, label="Discrimination Against Whites", colour = "grey60", size=6, fontface="bold")
plot1
ggsave(plot1, file="main_effect_block_fe.png", width=5, height=3, scale=2)
all3<-read.dta("interaction discrimination by state.dta")
attach(all3)
pd <- position_dodge(width=0.62)
color.names <- c("#000000", "#bdbdbd")
plot1<-ggplot(all3, aes(y=coef,  x=interaction))+
geom_hline(aes(yintercept=0), colour="#990000", linetype="dashed", size=2) +
geom_point(data=all3, size=8,  aes(colour = factor(interaction)), position = pd) +
facet_wrap(~state_abbrev, nrow=10)  +
geom_errorbar(data=all3, aes(ymin=coef-1.96*stderr, ymax= coef+1.96*stderr, colour = factor(interaction)), position = pd, width=0, size=1) +
geom_errorbar(data=all3, aes(ymin=coef-1.64*stderr, ymax= coef+1.64*stderr, colour = factor(interaction)), position = pd, width=0, size=3)+
scale_colour_manual(values=color.names) + theme_bw() + theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(), axis.line = element_line(colour = "black")) +
theme(legend.title = element_blank()) +
theme(legend.position="none", legend.direction="horizontal") +
labs(x="", y="Difference in Discrimination Effect Between Public and Elected Officials", title="") +
theme(text = element_text(size=30)) +
theme(axis.text.x = element_text(angle=90, hjust = 1)) +
coord_flip() +
theme(axis.title.y=element_blank(),
axis.text.y=element_blank(),
axis.ticks.y=element_blank()) +
labs(caption = "Lower = Elected Officials Discriminate More \n Higher = Public Discriminate More")
plot1
ggsave(plot1, file="interaction_effects.pdf", width=16, height=8, scale=2)
all3<-read.dta("/Users/johnholbein/Dropbox (Batten School @ UVA)/Work/Audit the Public/Data/survey data/interaction discrimination by state.dta")
all3<-read.dta("/Users/johnholbein/Dropbox (Batten School @ UVA)/Work/Audit the Public/Data/survey data/interaction discrimination by state.dta")
View(all3)
attach(all3)
pd <- position_dodge(width=0.62)
color.names <- c("#000000", "#bdbdbd")
plot1<-ggplot(all3, aes(y=coef,  x=interaction))+
geom_hline(aes(yintercept=0), colour="#990000", linetype="dashed", size=2) +
geom_point(data=all3, size=8,  aes(colour = factor(interaction)), position = pd) +
facet_wrap(~state_abbrev, nrow=10)  +
geom_errorbar(data=all3, aes(ymin=coef-1.96*stderr, ymax= coef+1.96*stderr, colour = factor(interaction)), position = pd, width=0, size=1) +
geom_errorbar(data=all3, aes(ymin=coef-1.64*stderr, ymax= coef+1.64*stderr, colour = factor(interaction)), position = pd, width=0, size=3)+
scale_colour_manual(values=color.names) + theme_bw() + theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(), axis.line = element_line(colour = "black")) +
theme(legend.title = element_blank()) +
theme(legend.position="none", legend.direction="horizontal") +
labs(x="", y="Difference in Discrimination Effect Between Public and Elected Officials", title="") +
theme(text = element_text(size=30)) +
theme(axis.text.x = element_text(angle=90, hjust = 1)) +
coord_flip() +
theme(axis.title.y=element_blank(),
axis.text.y=element_blank(),
axis.ticks.y=element_blank()) +
labs(caption = "Lower = Elected Officials Discriminate More \n Higher = Public Discriminate More")
plot1
ggsave(plot1, file="interaction_effects.pdf", width=16, height=8, scale=2)
View(all3)
all3<-read.dta("interaction discrimination by state.dta")
attach(all3)
pd <- position_dodge(width=0.62)
color.names <- c("#000000", "#bdbdbd")
plot1<-ggplot(all3, aes(y=coef,  x=interaction))+
geom_hline(aes(yintercept=0), colour="#990000", linetype="dashed", size=2) +
geom_point(data=all3, size=8,  aes(colour = factor(interaction)), position = pd) +
facet_wrap(~state_abbrev, nrow=10)  +
geom_errorbar(data=all3, aes(ymin=coef-1.96*se, ymax= coef+1.96*se, colour = factor(interaction)), position = pd, width=0, size=1) +
geom_errorbar(data=all3, aes(ymin=coef-1.64*se, ymax= coef+1.64*se, colour = factor(interaction)), position = pd, width=0, size=3)+
scale_colour_manual(values=color.names) + theme_bw() + theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(), axis.line = element_line(colour = "black")) +
theme(legend.title = element_blank()) +
theme(legend.position="none", legend.direction="horizontal") +
labs(x="", y="Difference in Discrimination Effect Between Public and Elected Officials", title="") +
theme(text = element_text(size=30)) +
theme(axis.text.x = element_text(angle=90, hjust = 1)) +
coord_flip() +
theme(axis.title.y=element_blank(),
axis.text.y=element_blank(),
axis.ticks.y=element_blank()) +
labs(caption = "Lower = Elected Officials Discriminate More \n Higher = Public Discriminate More")
plot1
ggsave(plot1, file="interaction_effects.pdf", width=16, height=8, scale=2)
all3<-read.dta("/Users/johnholbein/Dropbox (Batten School @ UVA)/Work/Audit the Public/Data/survey data/interaction discrimination by state.dta")
attach(all3)
all3<-read.dta("/Users/johnholbein/Dropbox (Batten School @ UVA)/Work/Audit the Public/Data/survey data/interaction discrimination by state.dta")
View(all3)
all3<-read.dta("/Users/johnholbein/Dropbox (Batten School @ UVA)/Work/Audit the Public/Data/survey data/interaction discrimination by state.dta")
attach(all3)
pd <- position_dodge(width=0.62)
color.names <- c("#000000", "#bdbdbd")
plot1<-ggplot(all3, aes(y=coef,  x=interaction))+
geom_hline(aes(yintercept=0), colour="#990000", linetype="dashed", size=2) +
geom_point(data=all3, size=8,  aes(colour = factor(interaction)), position = pd) +
facet_wrap(~state_abbrev, nrow=10)  +
geom_errorbar(data=all3, aes(ymin=coef-1.96*se, ymax= coef+1.96*se, colour = factor(interaction)), position = pd, width=0, size=1) +
geom_errorbar(data=all3, aes(ymin=coef-1.64*se, ymax= coef+1.64*se, colour = factor(interaction)), position = pd, width=0, size=3)+
scale_colour_manual(values=color.names) + theme_bw() + theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(), axis.line = element_line(colour = "black")) +
theme(legend.title = element_blank()) +
theme(legend.position="none", legend.direction="horizontal") +
labs(x="", y="Difference in Discrimination Effect Between Public and Elected Officials", title="") +
theme(text = element_text(size=30)) +
theme(axis.text.x = element_text(angle=90, hjust = 1)) +
coord_flip() +
theme(axis.title.y=element_blank(),
axis.text.y=element_blank(),
axis.ticks.y=element_blank()) +
labs(caption = "Lower = Elected Officials Discriminate More \n Higher = Public Discriminate More")
plot1
ggsave(plot1, file="interaction_effects.pdf", width=16, height=8, scale=2)
priority<-read.csv("Racial Animus by State.csv")
#priority<-read.csv("correlation_matrix_audit.csv")
head(priority)
priority$X <- priority$State <- priority$Abbreviation <- priority$Code <- priority$pop_covered <- NULL
colnames(priority)
priority.cor <- cor(priority)
priority.cor
axislabels <- c("Racially Charged Search Rate",
"MrP Estimates",
"Racial Resentment Among Whites",
"Racial Resentment",
"Number of Hate Groups",
"Average Hate Crimes",
"Hate Crimes",
"Implicit Association Test",
"Average Hate Crimes per 10k",
"Hate Crimes per 10k (2015)")
axislabelsy <- c("Average Hate Crimes per 10k",
"Racially Charged Search Rate",
"MrP Estimates",
"Racial Resentment Among Whites",
"Racial Resentment",
"Number of Hate Groups",
"Average Hate Crimes",
"Hate Crimes",
"Implicit Association Test",
"Hate Crimes per 10k")
library(ggcorrplot)
g <- ggcorrplot(priority.cor, hc.order = TRUE, type = "lower",
outline.col = "white", lab = T, colors = c("#762a83", "#f7f7f7", "#1b7837"))
g1 <- g +   scale_x_discrete(labels= axislabels) +
theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
scale_y_discrete(labels= axislabelsy)
g1
ggsave(g1, file="alternate_corrplot.pdf", width=6, height=6, scale=2)
priority<-read.csv("Racial Animus by State.csv")
head(priority)
priority$X <- priority$State <- priority$Abbreviation <- priority$Code <- priority$pop_covered <- NULL
colnames(priority)
priority.cor <- cor(priority)
priority.cor
axislabels <- c("Racially Charged Search Rate",
"MrP Estimates",
"Racial Resentment Among Whites",
"Racial Resentment",
"Number of Hate Groups",
"Average Hate Crimes",
"Hate Crimes",
"Implicit Association Test",
"Average Hate Crimes per 10k",
"Hate Crimes per 10k (2015)")
axislabelsy <- c("Average Hate Crimes per 10k",
"Racially Charged Search Rate",
"MrP Estimates",
"Racial Resentment Among Whites",
"Racial Resentment",
"Number of Hate Groups",
"Average Hate Crimes",
"Hate Crimes",
"Implicit Association Test",
"Hate Crimes per 10k")
library(ggcorrplot)
g <- ggcorrplot(priority.cor, hc.order = TRUE, type = "lower",
outline.col = "white", lab = T, colors = c("#762a83", "#f7f7f7", "#1b7837"))
g1 <- g +   scale_x_discrete(labels= axislabels) +
theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
scale_y_discrete(labels= axislabelsy)
g1
ggsave(g1, file="alternate_corrplot.pdf", width=6, height=6, scale=2)
library(ggcorrplot)
g <- ggcorrplot(priority.cor, hc.order = TRUE, type = "lower",
outline.col = "white", lab = T, colors = c("#762a83", "#f7f7f7", "#1b7837"))
priority<-read.csv("correlation_matrix_audit.csv")
priority<-read.csv("correlation_matrix_audit.csv")
head(priority)
priority$X <- priority$State <- priority$Abbreviation <- priority$Code <- priority$pop_covered <- NULL
colnames(priority)
priority.cor <- cor(priority)
priority.cor
axislabels <- c("Racially Charged Search Rate",
"MrP Estimates",
"Racial Resentment Among Whites",
"Racial Resentment",
"Number of Hate Groups",
"Average Hate Crimes",
"Hate Crimes",
"Implicit Association Test",
"Average Hate Crimes per 10k",
"Hate Crimes per 10k (2015)")
axislabelsy <- c("Average Hate Crimes per 10k",
"Racially Charged Search Rate",
"MrP Estimates",
"Racial Resentment Among Whites",
"Racial Resentment",
"Number of Hate Groups",
"Average Hate Crimes",
"Hate Crimes",
"Implicit Association Test",
"Hate Crimes per 10k")
library(ggcorrplot)
g <- ggcorrplot(priority.cor, hc.order = TRUE, type = "lower",
outline.col = "white", lab = T, colors = c("#762a83", "#f7f7f7", "#1b7837"))
g1 <- g +   scale_x_discrete(labels= axislabels) +
theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
scale_y_discrete(labels= axislabelsy)
g1
ggsave(g1, file="alternate_corrplot.pdf", width=6, height=6, scale=2)
priority<-read.csv("correlation_matrix_audit.csv")
head(priority)
priority$X <- priority$State <- priority$Abbreviation <- priority$Code <- priority$pop_covered <- NULL
colnames(priority)
priority.cor <- cor(priority)
priority.cor
axislabels <- c("Racially Charged Search Rate",
"MrP Estimates",
"Racial Resentment Among Whites",
"Racial Resentment",
"Number of Hate Groups",
"Average Hate Crimes",
"Hate Crimes",
"Implicit Association Test",
"Average Hate Crimes per 10k",
"Hate Crimes per 10k (2015)")
axislabelsy <- c("Average Hate Crimes per 10k",
"Racially Charged Search Rate",
"MrP Estimates",
"Racial Resentment Among Whites",
"Racial Resentment",
"Number of Hate Groups",
"Average Hate Crimes",
"Hate Crimes",
"Implicit Association Test",
"Hate Crimes per 10k")
library(ggcorrplot)
g <- ggcorrplot(priority.cor, hc.order = TRUE, type = "lower",
outline.col = "white", lab = T, colors = c("#762a83", "#f7f7f7", "#1b7837"))
g1 <- g +   scale_x_discrete(labels= axislabels) +
theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
scale_y_discrete(labels= axislabelsy)
g1
ggsave(g1, file="alternate_corrplot.pdf", width=6, height=6, scale=2)
setwd("/Users/johnholbein/Dropbox (Batten School @ UVA)/Work/Audit the Public/Data/state racism rankings/cleaned data/")
priority<-read.csv("Racial Animus by State.csv")
#priority<-read.csv("correlation_matrix_audit.csv")
head(priority)
priority$X <- priority$State <- priority$Abbreviation <- priority$Code <- priority$pop_covered <- NULL
colnames(priority)
priority.cor <- cor(priority)
priority.cor
axislabels <- c("Racially Charged Search Rate",
"MrP Estimates",
"Racial Resentment Among Whites",
"Racial Resentment",
"Number of Hate Groups",
"Average Hate Crimes",
"Hate Crimes",
"Implicit Association Test",
"Average Hate Crimes per 10k",
"Hate Crimes per 10k (2015)")
axislabelsy <- c("Average Hate Crimes per 10k",
"Racially Charged Search Rate",
"MrP Estimates",
"Racial Resentment Among Whites",
"Racial Resentment",
"Number of Hate Groups",
"Average Hate Crimes",
"Hate Crimes",
"Implicit Association Test",
"Hate Crimes per 10k")
library(ggcorrplot)
g <- ggcorrplot(priority.cor, hc.order = TRUE, type = "lower",
outline.col = "white", lab = T, colors = c("#762a83", "#f7f7f7", "#1b7837"))
g1 <- g +   scale_x_discrete(labels= axislabels) +
theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
scale_y_discrete(labels= axislabelsy)
g1
ggsave(g1, file="../../../Figures/alternate_corrplot.pdf", width=6, height=6, scale=2)
setwd("/Users/johnholbein/Dropbox (Batten School @ UVA)/Work/Audit the Public/Data/state racism rankings/cleaned data/")
priority<-read.csv("Racial Animus by State.csv")
#priority<-read.csv("correlation_matrix_audit.csv")
head(priority)
priority$X <- priority$State <- priority$Abbreviation <- priority$Code <- priority$pop_covered <- NULL
colnames(priority)
priority = subset(priority, select = -c(hatecrimes10k,hatecrimes2015, hatecrimes2015by10k, hategroups) )
priority.cor <- cor(priority)
priority.cor
axislabels <- c("Racially Charged Search Rate",
"MrP Estimates",
"Racial Resentment Among Whites",
"Racial Resentment",
"Implicit Association Test",
"Hate Crimes")
axislabelsy <- c("Number of Hate Groups",
"Racially Charged Search Rate",
"MrP Estimates",
"Racial Resentment Among Whites",
"Racial Resentment",
"Implicit Association Test"
)
library(ggcorrplot)
g <- ggcorrplot(priority.cor, hc.order = TRUE, type = "lower",
outline.col = "white", lab = T, colors = c("#762a83", "#f7f7f7", "#1b7837"))
g1 <- g +  scale_x_discrete(labels= axislabels) +
theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
scale_y_discrete(labels= axislabelsy)
g1
ggsave(g1, file="../../../Figures/alternate_corrplot_pared.pdf", width=6, height=6, scale=2)
priority<-read.csv("Racial Animus by State.csv")
#priority<-read.csv("correlation_matrix_audit.csv")
head(priority)
priority$X <- priority$State <- priority$Abbreviation <- priority$Code <- priority$pop_covered <- NULL
colnames(priority)
priority = subset(priority, select = -c(hatecrimes10k,hatecrimes2015, hatecrimes2015by10k, hategroups) )
priority.cor <- cor(priority)
priority.cor
axislabels <- c("Racially Charged Search Rate",
"MrP Estimates",
"Racial Resentment Among Whites",
"Racial Resentment",
"Implicit Association Test",
"Hate Crimes")
axislabelsy <- c("Number of Hate Groups",
"Racially Charged Search Rate",
"MrP Estimates",
"Racial Resentment Among Whites",
"Racial Resentment",
"Implicit Association Test"
)
library(ggcorrplot)
g <- ggcorrplot(priority.cor, hc.order = TRUE, type = "lower",
outline.col = "white", lab = T, colors = c("#762a83", "#f7f7f7", "#1b7837"))
g1 <- g +  scale_x_discrete(labels= axislabels) +
theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
scale_y_discrete(labels= axislabelsy)
g1
ggsave(g1, file="alternate_corrplot_pared.pdf", width=6, height=6, scale=2)
g1
ggsave(g1, file="alternate_corrplot_pared.pdf", width=6, height=6, scale=2)
setwd("/Users/johnholbein/Dropbox (Batten School @ UVA)/Work/Audit the Public/Data/Replication Data/") # set working directory
priority<-read.csv("Racial Animus by State.csv")
#priority<-read.csv("correlation_matrix_audit.csv")
head(priority)
priority$X <- priority$State <- priority$Abbreviation <- priority$Code <- priority$pop_covered <- NULL
colnames(priority)
priority = subset(priority, select = -c(hatecrimes10k,hatecrimes2015, hatecrimes2015by10k, hategroups) )
priority.cor <- cor(priority)
priority.cor
axislabels <- c("Racially Charged Search Rate",
"MrP Estimates",
"Racial Resentment Among Whites",
"Racial Resentment",
"Implicit Association Test",
"Hate Crimes")
axislabelsy <- c("Number of Hate Groups",
"Racially Charged Search Rate",
"MrP Estimates",
"Racial Resentment Among Whites",
"Racial Resentment",
"Implicit Association Test"
)
library(ggcorrplot)
g <- ggcorrplot(priority.cor, hc.order = TRUE, type = "lower",
outline.col = "white", lab = T, colors = c("#762a83", "#f7f7f7", "#1b7837"))
g1 <- g +  scale_x_discrete(labels= axislabels) +
theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
scale_y_discrete(labels= axislabelsy)
g1
ggsave(g1, file="alternate_corrplot_pared.pdf", width=6, height=6, scale=2)
